package com.cnct.springbootthymeleaf.jpa;


import com.cnct.springbootthymeleaf.entity.User;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.io.Serializable;

public interface UserJPA extends
        JpaRepository<User, Integer>,
        JpaSpecificationExecutor<User>,
        Serializable {
    @Query(value = "select * from user where name = :username and password = :password",nativeQuery = true)
    User findOne(@Param("username") String username, @Param("password") String password);
}
